




using System;
using System.Data;using THSERP.BusinessEntities;using THSERP.BaseProvider;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Windows.Forms;
using THSLib;using THSERP.BaseProvider;

namespace THSERP.Modules.Stock
{
    public class StockEntities : ERPModuleEntities
    {
        #region Declare Constant
        public readonly static String strICStocksObjectName = "ICStocks";

        public readonly static String strICStockSlotsObjectName = "ICStockSlots";
        #endregion
        
        #region Declare all entities variables
        private ICStocksInfo _iCStocksObject;
        private ICStockSlotsInfo _iCStockSlotsObject;
 
        public THSList<ICStockSlotsInfo> lstICStockSlots;
        #endregion

        #region Public Properties
        public ICStocksInfo ICStocksObject
        {
            get
            {
                return _iCStocksObject;
            }
            set
            {
                _iCStocksObject = value;
            }
        }
        public ICStockSlotsInfo iCStockSlotsObject
        {
            get
            {
                return _iCStockSlotsObject;
            }
            set
            {
                _iCStockSlotsObject = value;
            }
        }

        public THSList<ICStockSlotsInfo> ICStockSlotsList
        {
            get
            {
                return lstICStockSlots;
            }
            set
            {
                lstICStockSlots = value;
            }
        }      
       
        #endregion

        #region Constructor
        public StockEntities()
            : base()
        {
            _iCStocksObject = new ICStocksInfo();

            _iCStockSlotsObject = new ICStockSlotsInfo();

            lstICStockSlots = new THSList<ICStockSlotsInfo>();
        }

        #endregion

        #region Init Main Object,Module Objects functions
        public override void InitMainObject()
        {

            MainObject = ICStocksObject;
        }

        public override void InitModuleObjects()
        {
            ModuleObjects.Add("ICStockSlots", iCStockSlotsObject);
        }

        public override void InitModuleObjectList()
        {            
            lstICStockSlots = new THSList<ICStockSlotsInfo>();
            //lstICStockSlots.InitTHSList(this, THSUtil.GetTableNameFromBusinessObjectType(typeof(ICStockSlotsInfo)));
            lstICStockSlots.InitTHSList(this, "ICStocks", "ICStockSlots");
        }

        public override void InitGridControlInTHSList()
        {
            lstICStockSlots.InitTHSListGridControl();
        }

        public override void SetDefaultModuleObjectsList()
        {
            try
            {
                lstICStockSlots.SetDefaultListAndRefreshGridControl();

            }
            catch (Exception)
            {
                return;
            }
        }

        #endregion

        #region Invalidate Module Objects functions


        public override void InvalidateModuleObjects(int iObjectID)
        {
            ICStockSlotsList.Invalidate(iObjectID);
        }


        #endregion

        #region Save Module Objects functions

        public override void SaveModuleObjects()
        {
            ICStockSlotsList.SaveItemObjects(true);
        }

        #endregion


    }
}
